CC=gcc
CFLAGS=-g -Wall
CJSON_OBJ = cJSON.o
CJSON_TEST = ctest

uname := $(shell sh -c 'uname -s 2>/dev/null || echo false')

SHARED = so

ifeq (Darwin, $(uname))
	SHARED = dylib
endif

all: $(CJSON_OBJ)
	$(CC) $(CFLAGS) $(CJSON_OBJ) test.c -o test -lm

$(CJSON_OBJ):

clean:
	$(RM) $(CJSON_OBJ)
	$(RM) test
